<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<#include "lib/lib.html" />
<title>添加菜单</title>
</head>
<body>
<div class="pd-20">
	<form action="${basePath}/function/addmenu.do" method="post" class="form form-horizontal" id="form-menu-add">
		<input type="hidden" name="appId" value="${appId!}" />
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>上级菜单：</label>
			<div class="formControls col-5"> <span class="select-box" >
				<select class="select" id="fid" name="fid" >
					<option value="-1" selected="selected">顶级分类</option>
					 <#if funList??&&funList?size gt 0>
					 <#list funList as ll >
					 <option value="${ll.id!}">${ll.funName!}</option>
					 </#list>
					 </#if>
				</select>
			</span> 
			</div>
			<div class="col-3"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>菜单名称：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="" placeholder="" id="funName" name="funName" datatype="*2-60" nullmsg="菜单名不能为空">
			</div>
			<div class="col-4"> </div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>菜单编码：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="" placeholder="" id="funCode" name="funCode" datatype="*2-60" nullmsg="菜单编码不能为空">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>菜单路径：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="" placeholder="" id="funPath" name="funPath" datatype="*5-60" nullmsg="菜单路径不能为空">
			</div>
			<div class="col-4"> </div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>导航排序：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="" placeholder="" id="funSort" name="funSort" datatype="*1-60000" nullmsg="菜单路径不能为空">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">备注：</label>
			<div class="formControls col-5">
				<textarea name="funRemark" cols="" rows="" class="textarea"  placeholder="说点什么...128个字符以内" dragonfly="true" onKeyUp="textarealength(this,100)"></textarea>
				<p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
$(function(){
	
	$("#form-menu-add").Validform({
		

		tiptype:2,
		ajaxPost:true,
		callback:function(data){
			$.Hidemsg()
			if(data.resultCode==200){
				layer.msg('保存成功!', {
					icon : 1,
					time : 1000
				});
				parent.location.replace("${basePath}/function/gomenulist.do");
				layer_close();
			}else{
				$("#form-menu-add").resetForm();
				layer.msg('保存失败，请你检查数据!', {
					icon : 1,
					time : 1000
				});
			}
		}
	
	
// 		tiptype:2,
// 		callback:function(form){
// 			//后台请求保存数据
// 			$.axse_async("${basePath}/function/addmenu.do",  $("#form-menu-add").serialize(), function(d){
// 				if(d.resultCode == 200){
// 					layer.msg('保存成功!', {
// 						icon : 1,
// 						time : 1000
// 					});
// 					var index = parent.layer.getFrameIndex(window.name);
// // 					parent.$('.btn-refresh').click();
// 					parent.layer.close(index);
// 					parent.location.replace("${basePath}/menu/gomenulist.do");
// 				}else{
// 					$("#form-menu-add")[0].reset();
// 					layer.msg('保存失败，请你检查数据!', {
// 						icon : 1,
// 						time : 1000
// 					});
// 				}
// 			},
// 			function(d){
// 				$("#form-menu-add")[0].reset();   
// 				layer.msg('保存失败，请你检查数据!', {
// 					icon : 1,
// 					time : 1000
// 				});
// 			});
		
// 		}
	});
});
</script>
</body>
</html>